import type { FormRules } from 'element-plus'

export interface FormField {
  prop: string
  label: string
  type: 'input' | 'select' | 'date' | 'checkbox' | 'radio'
  required?: boolean
  span?: number
  xs?: number
  sm?: number
  md?: number
  lg?: number
  rules?: FormRules
  placeholder?: string
  componentProps?: Record<string, any>
}

export interface DynamicFormProps {
  fields: FormField[]
  initialData?: Record<string, any>
  labelWidth?: string
  gutter?: number
  showAddField?: boolean
}